﻿#region Using namespaces

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Data;
using System.Windows.Media;

#endregion

namespace BOL.Apps.GeneNetworkBrowser.Converters
{
    public class HSVColorConverter : IMultiValueConverter
    {
        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            double h = Double.Parse(values[0].ToString());
            double s = Double.Parse(values[1].ToString());
            double v = Double.Parse(values[2].ToString());

            return new SolidColorBrush(ColorSystems.FromHSV(h, s, v));
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotSupportedException();
        }
    } 
}
